
import java.util.Scanner;

public class A_2_6 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int t,num = 0;
        while(sc.hasNextLine()) {
            int a = 0,b = 0,c,f=-1;
            String str;
            char[] ch = new char[10];
            str = sc.nextLine();
            ch = str.toCharArray();
            StringBuilder sb = new StringBuilder();
            for(char v:ch) {
                if(v!='+'&&v!='-'&&v!='='&&v!='?') {
                    sb.append(v);
                }else if (v=='+') {
                    f = 1;
                    a = Integer.parseInt(sb.toString());
                    sb = new StringBuilder();
                }else if (v=='-') {
                    f = 0;
                    a = Integer.parseInt(sb.toString());
                    sb = new StringBuilder();
                }else if (v=='=') {
                    b = Integer.parseInt(sb.toString());
                    sb = new StringBuilder();
                }else if (v=='?') {
                    a=9999;
                }
            }
            try {
                c = Integer.parseInt(sb.toString());
            } catch (Exception e) {
                c=99999;
            }

            if (f==1) {
                if (a+b==c) {
                    num++;
                }
            }else if (a-b==c) {
                num++;
            }
        }
        System.out.println(num);

    }

}
